<!doctype html>
<html>
<head>
<meta charset="utf-8">
    <title>分享顾客</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">     
    <meta content="yes" name="apple-mobile-web-app-capable">     
    <meta content="black" name="apple-mobile-web-app-status-bar-style">     
    <meta content="telephone=no" name="format-detection">
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" type="text/css" href="/H5/css/sm.min.css" />
    <link rel="stylesheet" type="text/css" href="/H5/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="/H5/css/commission.css?v=2" />
</head>            
<body>
	<div class="page-group ms-controller" :controller="myshare">
        <div class="page page-current">
            <header class="bar bar-nav">
              	<a class="icon icon-left pull-left" href="javascript:window.history.go(-1);"></a>
              	<a class="icon icon-home pull-right" href="/H5"></a>
              	<h1 class="title">我的团队</h1>
            </header>
            <div class="content visibility infinite-scroll infinite-scroll-bottom" data-distance="100" style="padding-top: 10px;">
                <div class="table" style="padding: 0 .3rem;background-size: cover;background-repeat: no-repeat">
                    <a :class="@uid?'':'img_right'" :for="el in @list" :attr="{'href': @uid?'javascript:;':'/H5/myshare?uid='+el.uid}">
                        <img :attr="{'src': el.avatar_url}" />
                        <div class="tel_left">
                            <span>{{el.nickname||'蚂蚁'}}</span>
                            <!--<span>{{el.mobile||'&#45;&#45;&#45;&#45;'}}</span>-->
                        </div>
                        <div class="tel_right">
                            <span :visible="el.vip_level>0" style="color:#fff; margin-top:.3rem;font-weight: normal; background-color: red; padding: 1px 5px; border-radius: 3px; font-size: .8rem;">{{el.vip_level_label}}</span>
                            <span :visible="el.vip_level<1" style="font-weight: normal; margin-top:.3rem; font-size: .8rem;">{{el.vip_level_label}}</span>
                            <span style="color:black;font-weight: normal; margin-left: 1rem; font-size: .8rem;">{{el.real_name}}</span>
                        </div>
                    </a>
                </div>
                <!-- <div :if="@more" class="infinite-scroll-preloader">
                    <div class="preloader"></div>
                </div> -->
			</div>
        </div>
    </div>
<script type='text/javascript' src='/H5/js/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/sm.min.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/avalon.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/simpleStorage.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/mall.js?v=10' charset='utf-8'></script>
<script>
	var Myshare = avalon.define({
		$id: "myshare",
		list: [],
        uid: Mall.parseUrl( window.location.href ).uid,
        data: {},
        loading: false,
        more: false,
        page_num: 1,
        page_size: 10,
		getList: function( t ){
            if( Myshare.loading ){
                return
            }
            Myshare.loading = true;
            var post = {};
            if( Myshare.uid ){
            	post = {
            		uid: Myshare.uid
            	}
            }
			Mall.request( "/api/UserDirectlyUnder", post )
				.always( function( data ){
                    if( data.error_code == 0 ){
                        Myshare.data = data.data;
                        Myshare.list = Myshare.list.concat( data.data.list );
                        if( Myshare.page_num == data.data.page_total ){
                            Myshare.more = false;
                        }
                        else{
                            if( data.data.list.length == 0 ){
                                Myshare.more = false;
                            }
                            else{
                                Myshare.more = true;
                            }
                        }
                        Myshare.page_num ++;
                    }
                    Myshare.loading = false;
				} )
			$( ".content" ).removeClass( "visibility" )
		},
        infinite: function(){
            $(document).on('infinite', '.infinite-scroll-bottom',function() {
                if( Myshare.more ){
                    Myshare.getList();
                }
            });
        }
	})
    Myshare.getList();
	// Myshare.infinite();
	avalon.scan( document.body );
</script>
</body>
</html>